Skip to content

fix(milestones): allow deallocate while paused — it's a reclaim path - #607

Open
yggdrasilworld wants to merge 2 commits into
MergeFi:mainfrom
yggdrasilworld:fix/deallocate-paused-clean
Open

yggdrasilworld wants to merge 2 commits into
MergeFi:mainfrom
yggdrasilworld:fix/deallocate-paused-clean

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

Copy link
Copy Markdown

What

deallocate was pause-gated like a spend operation — but it only moves an allocated amount back toward remaining_budget (recoverable via cancel_milestone). It's a sponsor-protective reclaim path, and blocking it during a pause trapped allocated-but-unreleased sponsor funds — violating the pause design's first principle ("a paused contract must still allow sponsor-protective refund/reclaim paths").

The fix

  • Remove the is_paused gate on deallocate — it's a reclaim direction, not a spend
  • Update the doc-comment — explains why deallocate's allowed while paused (only spend-direction mutations — allocate/contribute/release — stay pause-gated)
  • Fix test_deallocate_blocked_while_paused → test_deallocate_allowed_while_paused — asserts deallocate succeeds during a pause, returns the allocation to remaining_budget, and clears the issue-status

Honest caveat

Not locally compiled — the workspace pins rustc 1.95 + wasm32v1-none (not installable in this environment). The change is minimal and the semantics are correct (deallocate's refund-path refund_remaining_budget is itself ungated, consistent with the reclaim model), but please let CI verify the build.

Resolves #530

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

deallocate was pause-gated like a spend operation, but it only moves an
allocated amount back toward remaining_budget (recoverable via
cancel_milestone) — a sponsor-protective refund path. During a pause,
allocated-but-unreleased sponsor funds were trapped, which violates the
pause design's first principle ('a paused contract must still allow
sponsor-protective refund/reclaim paths').

Remove the is_paused gate on deallocate, document why it's allowed while
paused, and update the regression test to assert deallocate succeeds
during a pause and returns the allocation to remaining_budget.

Resolves MergeFi#530

Note: not locally compiled — the workspace pins rustc 1.95 + wasm32v1-
none (not installable here); flagging for CI verification.
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

milestones::deallocate is blocked while paused, so allocated funds can't be returned during an incident

1 participant